Skip to content

Add dont-steal-focus configuration property.#85

Open
sarg wants to merge 1 commit into
emacs-exwm:mainfrom
sarg:iss-732
Open

Add dont-steal-focus configuration property.#85
sarg wants to merge 1 commit into
emacs-exwm:mainfrom
sarg:iss-732

Conversation

@sarg

@sarg sarg commented Oct 15, 2024

Copy link
Copy Markdown
Contributor

Some applications send _NET_ACTIVE_WINDOW to activate their window. EXWM respects this message always and brings such up into focus. This might be unintended and there should be a way to turn this off. In my case the app is Spotify desktop client installed from Flatpak.

Fixes ch11ng/exwm#732

@walseb

walseb commented Oct 15, 2024

Copy link
Copy Markdown
Contributor

Great PR, I have been disabling this piece of code for months with no issues.

I believe without it removed steam is very annoying to use because it constantly calls the focus steal event.

Probably it should be configurable which events emacs should listen to. Or each event could have a list of hooks so you can run functions whenever an event is fired, or remove functions from that list.

@Stebalien Stebalien left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable with a few nits.

But I have to ask the annoying question: have you signed your FSF paperwork for Emacs? EXWM is considered a part of Emacs for copyright purposes. This kind of change is probably minor enough that we can call it "copyright exempt", but it would be good to know for future reference.

Comment thread exwm-manage.el
(alist :key-type (key-sequence :tag "From")
:value-type (key-sequence :tag "To")))
((const :tag "Workspace" workspace) integer)
((const :tag "Don't steal focus" dont-steal-focus) boolean)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document above please

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread exwm.el Outdated
Comment thread exwm-manage.el Outdated
* prefix-keys: `exwm-input-prefix-keys' local to this X window.
* simulation-keys: `exwm-input-simulation-keys' local to this X window.
* workspace: The initial workspace.
* dont-steal-focus: Ignore _NET_ACTIVE_WINDOW signal from this X window.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "Ignore focus/raise requests from this X window." Avoids users having to know what "_NET_ACTIVE_WINDOW" means.

But now I'm in the "super nits" territory so I'm happy with leaving it as-is if you find it more clear that way.

@sarg sarg Oct 16, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's use the wording of official documentation: https://specifications.freedesktop.org/wm-spec/1.3/ar01s03.html#id-1.4.10

@sarg

sarg commented Oct 15, 2024

Copy link
Copy Markdown
Contributor Author

I haven't assigned the copyright yet. I've contributed a small patch to emacs some years ago, combined with this one it gives more than 15 changed lines. Does that mean I must do the paperwork now?

@Stebalien

Copy link
Copy Markdown
Member

If possible. If not, 15 isn't some magic number codified in law so I don't think it'll be real issue.

But I'm guessing you'll continue submitting small patches. In that case, it would be better to just get the copyright paperwork out of the way (it's a reasonably painless unless the company you work for tries to claim ownership of everything you do outside of working hours).

@minad

minad commented Oct 15, 2024

Copy link
Copy Markdown
Member

As far as I know, the small patch limit can somehow add up, leading to something non-trivial in the end, maybe even across parts of the overall GNU/Emacs project. It depends on who you ask. But to be strictly legally safe it is better to go with the copyright assignment.

Some applications send _NET_ACTIVE_WINDOW to activate their window. EXWM
respects this message always and brings such up into focus. This might
be unintended and there should be a way to turn this off. In my case the
app is Spotify desktop client installed from Flatpak.

Fixes ch11ng/exwm#732
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prevent an application from stealing focus

4 participants